<template>
    <div>
        <div id="userList">
            <el-table
                :data="users"
                 v-loading="loading"
                style="width: 100%">
                <el-table-column
                    prop="id"
                    label="ID"
                    width="180">
                </el-table-column>
                <el-table-column
                    prop="account"
                    label="账号"
                    width="180">
                </el-table-column>
                <el-table-column
                    prop="name"
                    label="姓名">
                </el-table-column>
                <el-table-column
                    prop="role"
                    label="权限">
                </el-table-column>
            </el-table>
        </div>
    </div>
</template>

<style lang="less">

</style>

<script>
// import { Message } from 'element-ui'
import { getAllUsers } from '@/api/user'

export default {
  data () {
    return {
      users: [{
        id: '',
        account: '',
        password: '',
        name: '',
        role: ''
      }],
      loading: true
    }
  },
  methods: {
  },
  mounted: async function () {
    const res = await getAllUsers()
    this.users = res.data
    this.loading = false
  }
}
</script>
